#include "BoardTextures.h"

// ############ Main Board ############

#define NUMBER_BOARD_TEXS 2

int active_main_board_tex_idx = 0;
CubeTexture active_main_board_texs;

CubeTexture main_board_texs[] = {
	{
	  { TEXPATH_BOARD1_TOP, "", TEXPATH_BOARD1_SIDE1, TEXPATH_BOARD1_SIDE2, TEXPATH_BOARD1_SIDE3, TEXPATH_BOARD1_SIDE4 },
	  { TEXID_BOARD1_TOP, -1, TEXID_BOARD1_SIDE1, TEXID_BOARD1_SIDE2, TEXID_BOARD1_SIDE3, TEXID_BOARD1_SIDE4 }
	},
	{
	  { TEXPATH_BOARD2_TOP, "", TEXPATH_BOARD2_SIDE1, TEXPATH_BOARD2_SIDE2, TEXPATH_BOARD2_SIDE3, TEXPATH_BOARD2_SIDE4 },
	  { TEXID_BOARD2_TOP, -1, TEXID_BOARD2_SIDE1, TEXID_BOARD2_SIDE2, TEXID_BOARD2_SIDE3, TEXID_BOARD2_SIDE4 }
	}
};

void loadMainBoardTextures() {

	active_main_board_texs = main_board_texs[0];
	
	for(int j = 0; j < NUMBER_BOARD_TEXS; ++j)
		for(int i = 0; i < 6; ++i) {
			loadTexture(main_board_texs[j].paths[i], main_board_texs[j].ids[i]);
		}
}

void nextMainBoard() {
	if( ++active_main_board_tex_idx == NUMBER_BOARD_TEXS )
		active_main_board_tex_idx = 0;
	active_main_board_texs = main_board_texs[active_main_board_tex_idx];
}


// ############ Bench Board ############

int active_bench_board_tex_idx = 0;
CubeTexture active_bench_board_texs;

CubeTexture bench_board_texs[] = {
	{
	  { TEXPATH_BENCH_BOARD1_TOP, "", TEXPATH_BENCH_BOARD1_SIDE1, TEXPATH_BENCH_BOARD1_SIDE2, TEXPATH_BENCH_BOARD1_SIDE3, TEXPATH_BENCH_BOARD1_SIDE4 },
	  { TEXID_BENCH_BOARD1_TOP, -1, TEXID_BENCH_BOARD1_SIDE1, TEXID_BENCH_BOARD1_SIDE2, TEXID_BENCH_BOARD1_SIDE3, TEXID_BENCH_BOARD1_SIDE4 }
	},
	{
	  { TEXPATH_BENCH_BOARD2_TOP, "", TEXPATH_BENCH_BOARD2_SIDE1, TEXPATH_BENCH_BOARD2_SIDE2, TEXPATH_BENCH_BOARD2_SIDE3, TEXPATH_BENCH_BOARD2_SIDE4 },
	  { TEXID_BENCH_BOARD2_TOP, -1, TEXID_BENCH_BOARD2_SIDE1, TEXID_BENCH_BOARD2_SIDE2, TEXID_BENCH_BOARD2_SIDE3, TEXID_BENCH_BOARD2_SIDE4 }
	}
};

void loadBenchBoardsTextures() {

	active_bench_board_texs = bench_board_texs[0];
	
	for(int j = 0; j < NUMBER_BOARD_TEXS; ++j)
		for(int i = 0; i < 6; ++i) {
			loadTexture(bench_board_texs[j].paths[i], bench_board_texs[j].ids[i]);
		}
}

void nextBenchBoard() {
	if( ++active_bench_board_tex_idx == NUMBER_BOARD_TEXS )
		active_bench_board_tex_idx = 0;
	active_bench_board_texs = bench_board_texs[active_bench_board_tex_idx];
}